package service;

import pojo.Visitor;
import util.ServiceException;

import javax.mail.MessagingException;
import javax.mail.internet.ParseException;
import javax.servlet.http.HttpServletRequest;

public interface VisitorRegisterService {

    /**
     * 根据邮箱查询用户
     * @param email
     * @return
     */
    Visitor findVisitorByEmail(String email);

    /**
     * 向数据库插入数据
     * @param visitor
     */
    void insertVisitor(Visitor visitor);

    /**
     * 处理注册
     * @param email
     * @param password
     * @throws MessagingException
     */
     void processregister(String email, String password, HttpServletRequest request) throws MessagingException;

    /**
     * 处理激活
     * @param email
     * @param validateCode
     * @throws ServiceException
     * @throws ParseException
     */
    boolean processActivate(String email , String validateCode)throws ServiceException, ParseException;

}
